package com.gzck.gzck_verson2;

import com.gzck.gzck_verson2.webSocket.ModbusTcpServer;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ComponentScans;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

@Slf4j
@SpringBootApplication
@EnableAsync
@MapperScan("com.gzck.gzck_verson2.mapper")
public class GzckVerson2Application {

    public static void main(String[] args) {
        SpringApplication.run(GzckVerson2Application.class, args);
        log.info("客户端启动");
    }


    @Bean
    public CommandLineRunner initialize(ModbusTcpServer modbusTcpServer) {
        return args -> {
            log.info("启动 Modbus 服务");
            modbusTcpServer.socketServer();
        };
    }

}
